import Vue from 'vue'
import Router from 'vue-router'
import NProgress from 'nprogress'
import routes from './routes'

Vue.use(Router)

let router = new Router({
  mode: 'history',
  routes: routes
})

router.beforeEach((to, from, next) => {
  NProgress.start()
  next()
})

router.afterEach(transition => {
  NProgress.done()
})

export default router
